package dto;

import java.util.ArrayList;
import java.util.Collection;

/**
 * @author hathao298
 * 
 */
public class RowDTO {

	private ArrayList<Object> value;

	public RowDTO() {
		this.value = new ArrayList<>();
	}

	public ArrayList<Object> getValue() {
		return value;
	}

	public void setValue(ArrayList<Object> value) {
		this.value = value;
	}

	public RowDTO(Collection<Object> val) {
		this.value = new ArrayList<>(val);
	}

	public String getValueAt(int index) {
		return value.get(index).toString();
	}

	public void setRow(ArrayList<Object> value) {
		this.value = value;
	}

	public void setValueAtIndex(int index, Object newval) {
		this.value.set(index, newval);
	}

	/**
	 * Add elements to current value but not changes anything to current value.
	 * @param row
	 * @return RowDTO
	 */
	public RowDTO addElements(RowDTO row){
		RowDTO temp = new RowDTO();
		temp.getValue().addAll(this.value);
		temp.getValue().addAll(row.getValue());
		return temp;
	}
	@Override
	public String toString() {
		return value.toString();
	}

}
